package main

import (
	"fmt"
	"log"

	"gitee.com/zzl/pag/internal/project"

	"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
	Use:   "Pag",
	Short: "Pag: Project tools",
	Long:  "Pag: Project tools, Example: pag new helloworld",
}

var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Version",
	Long:  "Show tools version",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Pag v1.0.0")
		return
	},
}

func init() {
	rootCmd.AddCommand(project.CmdNew)
	rootCmd.AddCommand(VersionCmd)
}

func main() {
	if err := rootCmd.Execute(); err != nil {
		log.Fatal(err)
	}
}
